﻿using DXApplicationTangche.UC.订单一览新.订单预览新.service;
using DXApplicationTangche.UC.金蝶;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.面料审核
{
    public partial class Form面料审核扫描订单 : DevExpress.XtraEditors.XtraForm
    {
        private List<OrderCommitDTO返回> orderCommitDTOs { get; set; }
        public Form面料审核扫描订单()
        {
            InitializeComponent();
            this.orderCommitDTOs = new List<OrderCommitDTO返回>();
        }

        private void textBox扫描生产批号_KeyDown(object sender, KeyEventArgs e)
        {
            if(e.KeyValue == 13)
            {
                OrderCommitDTO返回 orderCommitDTO = new OrderCommitDTO返回();
                orderCommitDTO = 订单预览新Service.get订单预览By批号(this.textBox扫描生产批号.Text.Trim());
                this.orderCommitDTOs.Add(orderCommitDTO);
                this.gridControl订单明细.DataSource = this.orderCommitDTOs;
                this.gridView订单明细.RefreshData();
                this.textBox扫描生产批号.Clear();
            }
        }

        private void simpleButton辅料出库预览_Click(object sender, EventArgs e)
        {
            List<String> orderIds = new List<string>();
            foreach(OrderCommitDTO返回 orderCommitDTO in this.orderCommitDTOs)
            {
                orderIds.Add(orderCommitDTO.orderId);
            }
            new Form金蝶BOM辅料出库(orderIds).ShowDialog();
        }
    }
}
